# ┌────────┐
# │ system │
# └────────┘

# Zsh history settings
HISTSIZE=100000
SAVEHIST=$HISTSIZE
HISTFILE=~/.zsh_history
setopt EXTENDED_HISTORY APPEND_HISTORY SHARE_HISTORY
setopt HIST_IGNORE_SPACE HIST_IGNORE_ALL_DUPS HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_DUPS HIST_FIND_NO_DUPS HIST_REDUCE_BLANKS
setopt HIST_VERIFY HIST_NO_STORE

# Zsh options
setopt extended_glob null_glob autocd PROMPT_SUBST NO_BEEP

setopt interactive_comments

# Completion configuration
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu select
bindkey '\t' menu-complete
bindkey '^[[Z' reverse-menu-complete

# Load completions with caching
autoload -Uz compinit
# Only run security check once per day
if [[ -n ${ZDOTDIR:-$HOME}/.zcompdump(#qN.mh+24) ]]; then
    compinit
else
    compinit -C
fi

# Disable flow control for better key bindings
stty -ixon

# Add newline before prompt
precmd() { print "" }
